package cas.ihep.pwa.fcn;

import cas.ihep.pwa.entity.ComputeResultMc;
import org.apache.spark.api.java.function.Function;
import scala.Tuple2;

public class McMapValuesFcn implements Function<Tuple2<ComputeResultMc,ComputeResultMc>,ComputeResultMc> {
    @Override
    public ComputeResultMc call(Tuple2<ComputeResultMc, ComputeResultMc> v) throws Exception {
        return new ComputeResultMc(v._1().totalAmpSquare/v._2().totalAmpSquare,v._1().Amps,v._1().msig);
    }
}
